/*! \brief Bitmap handler class.
*
* Inherited class from Bounding Box allowing to buffer one bitmap.\ Also has
*  coordinates
*/
#ifndef __SPRITE__
#define __SPRITE__

#include <allegro.h>
#include "bounding_box.h"

class Sprite : public BoundingBox {
  public:
    /*! \brief Class constructor 1.
    *
    * Create a sprite and initialize its bitmap resource with a file
    * \param spr_path is the path of the bitmap
    */
    Sprite(const char * spr_path);
    /*! \brief Class constructor 2.
    * Create a sprite with no memory allocated.
    */
    Sprite();
    /*! \brief Return the Sprite's bitmap resource.
    *
    * \return the bitmap pointer
    */
    virtual BITMAP * __getSprite();    
    /*! \brief Change the bitmap pointer to a new bitmap.
    *
    * \param nBMP is the new bitmap pointer
    */
    void __setBitmap(BITMAP * nBMP);
    /*! \brief Move the sprite horizontally.
    *
    * Move the sprite horizontally using a distance (in pixels)
    * \param val an integer distance
    */
    void __moveX(int val);
    /*! \brief Move the sprite vertically.
    *
    * Move the sprite vertically using a distance (in pixels)
    * \param val an integer distance
    */    
    void __moveY(int val);
    /*! \brief Move the sprite.
    *
    * Move the sprite both horizontally & vertically using a distance (in pixels)
    * \param xVal an integer distance (horizontal distance)
    * \param yVal an integer distance (vertical distance)
    */    
    void __move(int xVal, int yVal);
    /*! \brief Set the X coordinate of the sprite
    *
    * \param val an integer coordinate
    */
    void __setX(int val);
    /*! \brief Set the Y coordinate of the sprite
    *
    * \param val an integer coordinate
    */    
    void __setY(int val);
    /*! \brief Get the X coordinate of the sprite
    *
    * \return an integer coordinate
    */
    int __getX();
    /*! \brief Get the Y coordinate of the sprite
    *
    * \return an integer coordinate
    */    
    int __getY();
    /*! \brief Tests a collision with another sprite
    *
    * \return true if sprites collide, else false
    */
    bool __collidesWith(Sprite * s);
    /*! \brief Hide/Display the sprite.
    *
    * \param s integer: status (1= Hidden/0= Visible)
    */
    void __hide(int s);
    
  protected:
    /**
    * Bitmap resource
    */
    BITMAP * _sprite; // Sprite Image resource
    /**
    * X Coordinate of the sprite
    */
    int _x;
    /**
    * Y Coordinate of the sprite
    */    
    int _y; // Sprite position
    
  private:
    /**
    * Hidden status
    */
    int _hidden;
};

#endif
